﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="LNBMS.Web.Index" %>

<%@ Register Assembly="FineUI" Namespace="FineUI" TagPrefix="f" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <meta name="sourcefiles" content="~/leftmenu.aspx" />
    <link type="text/css" rel="stylesheet" href="./res/main.css" />
    <link rel="stylesheet" href="./res/leaflet.css" />
    <style type="text/css">
		div.map {
			display: block;
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
		}
	</style>
    <script type="text/javascript" src="./res/js/leaflet-src.js"></script>
    <script type="text/javascript" src="./res/js/tile.js"></script>
    <script type="text/javascript">
        function initialize() {
            //var stamen = new L.StamenTileLayer("toner-lite");
            var myLayer = new L.TileLayer.WMS("http://103.39.78.168:8080/qgis_mapserv.slg", {
                map: "C:/gis/zhongguo.qgs",  //自定义参数,自己加的参数,在URL中表现为&参数名="具体参数"
                layers: 'cjm',
                format: 'image/png',
                attribution: '浙江农林大学',
                version: '1.3.0',
                transparent: 'TRUE'   //透明度参数,
                //bbox:[100,2,-67,50]  地图范围
                //				id:'11'
            });

            //			L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', {
            //				maxZoom: 18,
            //				attribution: 'LNB',
            //				id: 'examples.map-i875mjb7'
            //			}).addTo(map);


            var map = new L.Map("map", {
                center: new L.LatLng(29.00063, 120.25008),
                zoom: 15,
                minZoom: 1,
                maxZoom: 18,

                //layers: [stamen,myLayer],//带底图
                layers: myLayer
            });
            //marker.bindPopup(popupContent).openPopup();

            var popup = L.popup()
				.setLatLng(new L.LatLng(29.00063, 120.25008))
				.setContent('<p>这是你家的地:<br />----林农宝提醒您</p>')
				.openOn(map);
            // define rectangle geographical bounds

            var bounds = [
				[54.559322, -5.767822],
				[56.1210604, -3.021240]
            ];
        }
    </script>
</head>
<body onload="initialize()">
    <form id="form1" runat="server">
        <f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server"></f:PageManager>
        <f:Panel ID="Panel1" Layout="Region" ShowBorder="false" ShowHeader="false" runat="server">
            <Items>
                <f:ContentPanel ID="ContentPanel1" RegionPosition="Top" ShowBorder="false" CssClass="jumbotron" ShowHeader="false" runat="server">
                    <div class="wrap">
                        <div class="logos">
                            林农宝后台管理
                        </div>
                        <div class="menu">
                            <ul>
                                <li class="selected menu-mail"><a href="javascript:;"><span>林地管理</span></a> </li>
                                <li class="menu-sms"><a href="javascript:;"><span>补偿发放</span></a> </li>
                                <li class="menu-sms"><a href="javascript:;"><span>林农商贸</span></a> </li>
                                <li class="menu-sms"><a href="javascript:;"><span>火情监测</span></a> </li>
                                <li class="menu-sms"><a href="javascript:;"><span>公告管理</span></a> </li>
                                <li class="menu-sys"><a href="javascript:;"><span>系统管理</span></a> </li>
                            </ul>
                        </div>
                        <div class="member">
                           欢迎 <%= loginMsg%>管理员!
                        </div>
                        <div class="exit">
                            <asp:HyperLink ID="exit" runat="Server" NavigateUrl="~/Login.aspx" OnDisposed="exit_Cilck">退出登录</asp:HyperLink>
                        </div>
                    </div>
                </f:ContentPanel>
                <f:Panel ID="Region2" RegionPosition="Left" RegionSplit="true" Width="200px"
                    ShowHeader="true" Title="业务菜单" IconUrl="res/icon/outline.png"
                    EnableCollapse="true" EnableIFrame="true" IFrameName="leftframe" IFrameUrl="about:blank"
                    runat="server">
                </f:Panel>
                <f:TabStrip ID="mainTabStrip" RegionPosition="Center" EnableTabCloseMenu="true" ShowBorder="false" runat="server">
                    <Tabs>
                        <f:Tab ID="Tab1" Title="首页" Layout="Fit" IconUrl="res/icon/house.png" CssClass="maincontent" runat="server">
                            <Items>
                                <f:ContentPanel ID="ContentPanel2" ShowBorder="false" BodyPadding="10px" ShowHeader="false" AutoScroll="true"
                                    runat="server" >
                                        <div id="map" class="map"></div>
                                </f:ContentPanel>
                            </Items>
                        </f:Tab>
                    </Tabs>
                </f:TabStrip>
            </Items>
        </f:Panel>
    </form>
    <script src="/res/js/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script>
        var mainTabStripClientID = '<%= mainTabStrip.ClientID %>';

        F.ready(function () {

            window.mainTabStrip = F(mainTabStripClientID);

            var menuLis = $('.menu ul li');

            function updateLeftMenu(menuType) {

                menuLis.removeClass('selected');
                menuLis.filter('.menu-' + menuType).addClass('selected');

                window.frames['leftframe'].location.href = './leftmenu.aspx?menu=' + encodeURIComponent(menuType);
            }

            // 点击顶部菜单，加载左侧IFrame菜单
            menuLis.click(function (e) {
                var $this = $(this);
                var classNames = /menu\-(\w+)/.exec($this.attr('class'));
                if (classNames.length == 2) {
                    var menuType = classNames[1];

                    updateLeftMenu(menuType);
                }
            });

            // 根据页面的Hash值，来初始化左侧IFrame菜单
            var hash = window.location.hash;
            var hashArray = /.+\/html\/(.+)\-\d+\.html/.exec(hash);
            if (hashArray && hashArray.length === 2) {
                updateLeftMenu(hashArray[1]);
            } else {
                updateLeftMenu('mail');
            }


            window.initTreeTabStrip = function (tree) {
                // 初始化主框架中的树(或者Accordion+Tree)和选项卡互动，以及地址栏的更新
                // treeMenu： 主框架中的树控件实例，或者内嵌树控件的手风琴控件实例
                // mainTabStrip： 选项卡实例
                // addTabCallback： 创建选项卡前的回调函数（接受tabConfig参数）
                // updateLocationHash: 切换Tab时，是否更新地址栏Hash值
                // refreshWhenExist： 添加选项卡时，如果选项卡已经存在，是否刷新内部IFrame
                // refreshWhenTabChange: 切换选项卡时，是否刷新内部IFrame
                // hashWindow：需要更新Hash值的窗口对象，默认为当前window
                F.util.initTreeTabStrip(tree, mainTabStrip, null, true, false, false);
            };

        });


    </script>
</body>
</html>
